package com.woniu.woniuproject.service;

import com.woniu.woniuproject.entity.Product;
import com.woniu.woniuproject.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 功能描述:<br>
 * 〈〉
 *
 * @author EDZ
 * @create 2020/11/18
 * @since 1.0.0
 */
@Service
public class ProductService {
    @Autowired
    ProductMapper productMapper;
    public List<Product> queryall(){
        List<Product> list = productMapper.selectAll();
        return list;
    }


    public int addone(Product tableData1) {
        return productMapper.insert(tableData1);
    }

    public int updateone(Product tableData1) {
        return productMapper.updateByPrimaryKey(tableData1);
    }

    public int deleteone(int product) {
        return productMapper.deleteByPrimaryKey(product);
    }
}